#!/usr/bin/env python 
# -*- coding:utf-8 -*-
"""
@Time:2022/3/5 下午2:52"
@Author:lydia_liu"
@File:login_page.py
@function:
"""

from selenium.webdriver.common.by import By

from litemallPrac.page.base_page import BasePage



class LoginPage(BasePage):
    _input_username = (By.XPATH, "//*[@name='username']", "admin123")
    _input_password = (By.XPATH, "//*[@name='password']", "admin123")
    _button_login = (By.XPATH, '//*[@class="el-button el-button--primary el-button--mini"]')

    def login(self):
        #在登录页面输入用户名和密码，点击登录
        # self.driver.get("http://litemall.hogwarts.ceshiren.com/#/login")

        self.sendkeys(*self._input_username)
        self.sendkeys(*self._input_password)
        self.on_click(*self._button_login)

        from litemallPrac.page.home_page import HomePage
        return HomePage(self.driver)
